package com.example.main.rottweiljson;

import com.example.main.rottweiljson.bean.JsonCommonFieldFormat;
import com.example.main.rottweiljson.bean.ParamValueBean;
import com.example.main.rottweiljson.bean.ResultJsonBean;

import java.util.Iterator;
import java.util.List;
import java.util.Map;


public class JsonMain {

    public static void main(String[] args) {

        JsonCommonFieldFormat jsonCommonFieldFormat = ParseRottweilJsonTempelet.getCommonJsonFormat();

        Map<String, ParamValueBean> paramMap = jsonCommonFieldFormat.createMapParamter();
        Iterator<String> iterator = paramMap.keySet().iterator();
        while (iterator.hasNext()) {
            String key = iterator.next();
            if ("date".equals(paramMap.get(key).getParamName())) {
                paramMap.get(key).setValue("2021-12-20");
            } else if ("bathch".equals(paramMap.get(key).getParamName())) {
            }
        }

        String realUrl = jsonCommonFieldFormat.getComposeUrl(paramMap);
        RottweilHttpRequest.request(realUrl, new RottweilHttpRequest.OnRequestListner() {
            @Override
            public void onResult(String result) {
                System.out.println(result);
                List<List<ResultJsonBean>> resultJsonBeanList = ParseRottweilJsonTempelet.getContentList(jsonCommonFieldFormat, result);
                int a = 0;
                a = 0;
            }
        });
    }

}
